Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug that caused the player to automatically hop onto slimes and… #531

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sarahvdr
Copy link

This PR addresses issue #426.

To fix it, I changed the colliders on problematic objects like slimes and small bushes from sphere colliders to box colliders. I downsized the box colliders to be slightly smaller than the actual object so as to make it as functionally close to a spherical collider as possible. This removes the possibility for the player to slide up the sphere's upper slope when moving too close to it. I also added some fail-safe code at the bottom of Protagonist.cs, where I check the distance between the player and bush/critter objects (identified by appropriate tags in Unity) to see if the objects are clipping (i.e. their colliders are overlapping), and lerping the player just outside of the object's collider if so.

Here are two videos demonstrating this fix, one where I try running up on, walking up on, and hitting bushes from different angles, and another where I do the same to a slime. In both videos and all my testing, I was unable to replicate the bug as before.
https://user-images.githubusercontent.com/73858910/233741891-dd266818-7946-45e8-86d4-f967283f76c7.mp4
https://user-images.githubusercontent.com/73858910/233741901-c83170f8-455b-4d0b-9f6d-15757e3639b7.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant